package xyz.dava.sync.fm.vo;

import lombok.Data;
import xyz.dava.sync.fm.util.BomUtil;

@Data
public class SapParam {
    private InputParams input_params;
    private Long signature_created;
    private String signature;

    public SapParam(InputParams params, String token) {
        this.input_params = params;
        this.signature_created = System.currentTimeMillis() / 1000;
        this.signature = BomUtil.getSignature(token, input_params, signature_created);
    }

    public SapParam(InputParams params, String token, Long time) {
        this.input_params = params;
        this.signature_created = time == null ? (System.currentTimeMillis() / 1000) : time;
        this.signature = BomUtil.getSignature(token, input_params, signature_created);
    }
}
